<!--
 * @Author: GKN
 * @Date: 2023-07-25 14:28:00
 * @LastEditTime: 2023-11-06 11:12:30
 * @LastEditors: GKN
 * @Description: 
 * @FilePath: \mod\src\view\components\ad.vue
 * 可以输入预定的版权声明、个性签名、空行等
-->
<template>
  <div class="cont" v-if="url">
      <imgView v-if="url" :src="url" type="ad" />
    <div @click.stop="close" :class="props.direction == 'right'?'close1':'close2'">X</div>
  </div>
</template>

<script setup>
import { ref,getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
import httpApi from '@/api/http'
import api from '@/api/api'
const props = defineProps({
    url: {
        type: String,
        default: "",
    },
    type: {
        type: String,
        default: "",
    },
    direction:{
        type: String,
        default: "",
    },
})
let emit = defineEmits(["titleClick"]);
const close = () => {
  emit("close");
};
</script>

<style lang='less' scoped>
.cont{
    width: 100%;
    height: 100%;
    img{
        width: 100%;
        height: 100%;
    }
    .close1{
        position: absolute;
        top: 0;
        left: 0;
        width: 16px;
        height: 16px;
        text-align: center;
        line-height: 16px;
        background: #d8dfeb;
        font-size: 10px;
        cursor: pointer;
        z-index: 111;
    }
    .close2{
        z-index: 111;
        position: absolute;
        top: 0;
        right: 0;
        width: 16px;
        height: 16px;
        text-align: center;
        line-height: 16px;
        background: #d8dfeb;
        font-size: 10px;
        cursor: pointer;
    }
}
</style>

